import { forwardRef, Ref, useImperativeHandle } from "react";

export interface RefProps {
  chileMethod: () => void;
}

const ChildComponent = ({ title = 'title' }, ref: Ref<RefProps>) => {
  useImperativeHandle(ref, () => {
    return {
      chileMethod: () => {
        console.log('233');
      }
    }
  }, [])

  return <div>{title}</div>;
}

export default forwardRef(ChildComponent);